#ifndef G3_RENDERER_H
#define G3_RENDERER_H

#include "log.h"
#include "input.h"
#include "color.h"
#include "projection.h"

#include "r_view.h"

#include <SDL/SDL.h>

namespace G3 {

class RENDERER {
    public:
        RENDERER ();
        RENDERER (int W, int H);
        RENDERER (int W, int H, float FOV = 45.0f, float Near = 0.01f, float Far = 100.0f);
        ~RENDERER ();

        int MaxWidth;
        int MaxHeight;

        VIEW Camera;
        INPUT *Input;

//==============================================================================
// Initializes OpenGL
//==============================================================================
        bool Create ();
        bool Create (int Width, int Height);

//==============================================================================
// Sets a perspective
//==============================================================================
        void SetPerspective ();
        void SetPerspective (int Width, int Height);
        void SetPerspective (int x1, int y1, int x2, int y2);

		void SetFieldOfView (float FOV);

//==============================================================================
// Renders a testgrid
//==============================================================================
        void RenderGrid (double GridSpacing = 1.0, COL3F GridColor = COL3F (1.0f, 1.0f, 1.0f), bool RenderAxis = true);

//==============================================================================
// Looks around with mouse
//==============================================================================
        void Look ();

//==============================================================================
// Clears buffers
//==============================================================================
        void ClearBuffer ();

//==============================================================================
// Swaps buffers for DoubleBuffering
//==============================================================================
        void SwapBuffer ();
};

}

#endif //P_RENDERER_H
